package org.example.bean;

import java.math.BigDecimal;

/**
 * 对应数据库表结构，存储电影类型的平均评分和该类型电影总数信息
 */
public class MovieTypeAvg {
    // 类型ID，对应数据库 type_id 字段，类型为 int
    private int typeId;
    // 平均评分，对应数据库 avg_score 字段，使用 BigDecimal 保证小数精度
    private BigDecimal avgScore;
    // 该类型电影总数，对应数据库 total_movies 字段，类型为 int
    private int totalMovies;

    public MovieTypeAvg() {
    }

    public MovieTypeAvg(int typeId, BigDecimal avgScore, int totalMovies) {
        this.typeId = typeId;
        this.avgScore = avgScore;
        this.totalMovies = totalMovies;
    }

    // Getter 和 Setter 方法
    public int getTypeId() {
        return typeId;
    }

    public void setTypeId(int typeId) {
        this.typeId = typeId;
    }

    public BigDecimal getAvgScore() {
        return avgScore;
    }

    public void setAvgScore(BigDecimal avgScore) {
        this.avgScore = avgScore;
    }

    public int getTotalMovies() {
        return totalMovies;
    }

    public void setTotalMovies(int totalMovies) {
        this.totalMovies = totalMovies;
    }

    @Override
    public String toString() {
        return "MovieTypeAvg{" +
                "typeId=" + typeId +
                ", avgScore=" + avgScore +
                ", totalMovies=" + totalMovies +
                '}';
    }
}